﻿using System;
using Microsoft.AspNetCore.Mvc;
using VegetableSale.NET.Entities;
using VegetableSale.NET.Services;

[ApiController]
[Route("api/[Action]")]
public class LoginController : Controller
{
    private UserService _userService = new UserService();

    [HttpPost(Name = "login")]
    public Result login([FromBody] LoginDTO loginDTO)
    {
        return _userService.Login(loginDTO.LoginName, loginDTO.Password);
    }
}